<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org"
	xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<link th:href="@{/assets/plugins/jquery-layout/jquery.layout-latest.css}" rel="stylesheet"/>
<head th:include="include::ztree-css"></head>
<style>

</style>
<body class="gray-bg">
	
	<div class="container-div ui-layout-center">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="user-form">
					<input type="hidden" id="deptId" name="deptId">
	                <input type="hidden" id="parentId" name="parentId">
					<div class="select-list">
						<ul>
							<li>
								考号或姓名：<input type="text" name="id"/>
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
							    <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
	        <div class="btn-group-sm hidden-xs" id="toolbar" role="group">
	        	<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="sys:user:add">
	                <i class="fa fa-plus"></i> 新增
	            </a>
	             <a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="sys:user:edit">
		            <i class="fa fa-edit"></i> 修改
		        </a>
	            <a class="btn btn-danger btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="sys:user:remove">
	                <i class="fa fa-remove"></i> 删除
	            </a>
	        </div>
	        
	        <div class="col-sm-12 select-table table-striped">
			    <table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
	
	<div th:include="include :: footer"></div>
	<script th:src="@{/assets/plugins/jquery-layout/jquery.layout-latest.js}"></script>
<div th:include="include::ztree-js"></div>
	<script th:inline="javascript">
		var prefix = ctx + "exam/exarrange";

		$(function() {
		    queryUserList();
		});

		function queryUserList() {
		    var options = {
		        url: prefix + "/listuser",
		        createUrl: prefix + "/kdadd",
		        updateUrl: prefix + "/kdedit/{id}",
		        removeUrl: prefix + "/kdremove",
		        sortName: "id",
		        sortOrder: "asc",
		        modalName: "考生",
		        search: false,
		        showExport: false,
		        columns: [{
		            checkbox: true
		        },
		        {
		            field: 'id',
		            title: '考号'//,visible: false
		        },
		        {
		            field: 'userName',
		            title: '用户姓名'
		        },
		        {
		            field: 'dept.deptId',
		            title: '部门'
		        },
		        {
		            field: 'classg',
		            title: '部门班级'
		        },
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		                var actions = [];
		                actions.push('<a class="btn btn-success btn-xs " href="#" onclick="$.operate.edit(\'' + row.id + '\')" shiro:hasPermission="sys:user:edit"><i class="fa fa-edit"></i>编辑</a> ');
		                actions.push('<a class="btn btn-danger btn-xs " href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
		                //actions.push('<a class="btn btn-success btn-xs " href="#" onclick="$.modal.alertSuccess(\'' + row.cardid.substr(-6) + '\')" ><i class="fa fa-search"></i>查看密码</a> ');
		                return actions.join('');
		            }
		        }]
		    };
		    $.table.init(options);
		}
	</script>
</body>

</html>